package com.aratek.mqtt.demo.mqttpush.controller;

import com.aratek.mqtt.demo.mqttpush.service.MqttGateway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
 
    @Autowired
    private MqttGateway mqttGateway;

    /**
     * 消息推送
     * @param sendData
     * @return
     */
    @RequestMapping("/sendMqtt.do")
    public String sendMqtt(String  sendData){
        mqttGateway.sendToMqtt(sendData,"hello1");
        return "OK";
    }
}